Skip to content

feat(pkg): add compat.libuv@1.48.0 and redis-plus-plus async feature - #195

Merged
Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
wellwei:codex/redis-plus-plus-async
Aug 9, 2026
Merged

feat(pkg): add compat.libuv@1.48.0 and redis-plus-plus async feature#195
Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
wellwei:codex/redis-plus-plus-async

Conversation

@wellwei

@wellwei wellwei commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

新增 compat.libuv + redis-plus-plus async feature

#188(compat.hiredis + compat.redis-plus-plus 同步核心,已合并)之后的独立新 PR,补齐 libuv 异步接口。

包与形态

内容
compat.libuv 1.48.0 Form A(C 源码,逐 OS 源清单转录自上游 CMakeLists)
compat.redis-plus-plus 新增 async feature(9 个 async TU + compat.libuv 依赖)
compat.hiredis 新增 hiredis/adapters/libuv.h 薄包装头

关键设计

  • libuv 源清单不能整体 glob:src/unix/*.c 每 OS 一个后端文件(aix/linux/darwin…),linux/macos 显式列子集,windows 用 src/win/*.c;defines/ldflags 与上游 CMakeLists 逐条对齐。
  • 版本选型:1.48.0(2024-04,Ubuntu 24.04 LTS 世代、vcpkg 长期默认;redis-plus-plus 只需 "libuv 1.x"),延续「经典、泛用、不追最新」。
  • async feature:event_loop.cpp 后台线程跑 uv_run;<uv.h>/<hiredis/adapters/libuv.h> 经 feature 激活的依赖 include 传播到达;future/std include dir 进基座(1.3.3 无副作用)。1.3.3 上两个 async TU glob 零命中(子集并集,与同步核心同款)。
  • include_dirs 暴露 */src:libuv 自身编译需 internal.hsrc/uv-common.h(先例 c-ares/protobuf)。

测试

  • 新成员 redis-plus-plus-async(1.3.13 + features=["async"]):进程内迷你 RESP server 解析完整 RESP 数组(异步客户端会把 PING+SET 管道进同一 TCP 段),驱动 AsyncRedis 端到端断言 PONG/OK,离线无网络。
  • 本地 CI 钉版 mcpp 2026.8.8.2:三个成员(同步 1.3.13 / 1.3.3 / async)全部 test result ok

验证

  • lint 全绿(语法/mirror/包名/跨包引用/平台一致性),钉版 mcpp xpkg parse 通过。
  • libuv 1.48.0 SHA 两次独立下载一致。

说明

wellwei added 2 commits August 9, 2026 14:40
- compat.libuv (Form A): per-OS source sets transcribed from upstream
  CMakeLists — src/unix/*.c cannot be globbed (one backend per OS), so linux/
  macosx list explicit unix subsets and windows globs src/win/*.c. 1.48.0 is
  the classic LTS-era release (Ubuntu 24.04 line, long-standing vcpkg default).
- compat.redis-plus-plus: 'async' feature = the 9 async TUs (event_loop.cpp
  runs uv_run on a background thread) + deps compat.libuv; future/std include
  dir added to the base (async_connection.h -> sw/redis++/async_utils.h).
- compat.hiredis: thin hiredis/adapters/libuv.h wrapper header.
- New member redis-plus-plus-async (1.3.13 + features=['async']): offline
  mini RESP server parses full RESP arrays (the async client pipelines
  PING+SET into one segment) and drives AsyncRedis end-to-end.
…dis-plus-plus#575)

Windows async teardown asserts in libuv src/win/handle.c:71: EventLoop's
LoopDeleter uv_walk re-closes handles already uv_close'd by hiredis's libuv
adapter cleanup (on Windows they stay in the loop's handle queue; on unix the
closing phase unlinks them first). uv_close's UV_HANDLE_CLOSING guard makes the
second call a harmless no-op — only the assert(0) aborts. NDEBUG matches libuv
release builds (vcpkg/conan) and disables the assert. Upstream open issue
sewenew/redis-plus-plus#575; caught by PR mcpplibs#195 windows workspace leg.
@Sunrisepeak
Sunrisepeak merged commit 42df174 into mcpplibs:main Aug 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants